<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\CategoryBean;

class CategoryValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 CategoryBean::$id => 'require', //
			 CategoryBean::$storeId => 'require', //
			 CategoryBean::$type => 'require', //类型（1 洗照片相纸、2洗照片尺寸，3证件照证件类型，4打印色彩，5打印大小）
			 CategoryBean::$name => 'require|max:255', //名称
			 CategoryBean::$price => 'require', //价格
			 CategoryBean::$createdAt => 'require', //
		];
		$this->message = [
			CategoryBean::$id.POINST."require " => 'id必须', //
			CategoryBean::$storeId.POINST."require " => 'store_id必须', //
			CategoryBean::$type.POINST."require " => 'type必须', //类型（1 洗照片相纸、2洗照片尺寸，3证件照证件类型，4打印色彩，5打印大小）
			CategoryBean::$name.POINST."require " => 'name必须', //名称
			CategoryBean::$price.POINST."require " => 'price必须', //价格
			CategoryBean::$createdAt.POINST."require " => 'created_at必须', //
		];
		$this->scene = [
			self::$all => [
				CategoryBean::$id,
				CategoryBean::$storeId,
				CategoryBean::$type,
				CategoryBean::$name,
				CategoryBean::$price,
				CategoryBean::$createdAt,
			],
			self::$add => [
			],
			self::$edit => [
			],
			self::$pkId => [],

		];
	}


}
